﻿using Microsoft.EntityFrameworkCore;
using Yz.Model.Entities;

namespace Yz.Model.Dal
{
    /// <summary>
    /// Yz数据库
    /// </summary>
    public class YzContext : DbContext
    {
        #region 数据库连接 

        public YzContext(DbContextOptions<YzContext> options) : base(options)
        {

        }
        #endregion


        #region 数据表
        /// <summary>
        /// 用户信息表
        /// </summary>
        public DbSet<User> Users { get; set; }
        /// <summary>
        /// 管理员信息表
        /// </summary>
        public DbSet<Admin> Admins { get; set; }
        /// <summary>
        /// 角色信息表
        /// </summary>
        public DbSet<Role> Roles { get; set; }
        #endregion


        #region 增加数据库表字段限制
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

        }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {


        }
        #endregion
    }
}
